package sample.test;

import static org.junit.Assert.assertEquals;

import java.util.Map;

import org.databene.benerator.anno.Source;
import org.databene.feed4junit.Feeder;
import org.junit.Test;
import org.junit.runner.RunWith;

import sample.code.UserAccess;

/*
 * Feed4JUnit - Get Data from CSV/Excel File source
 */

@RunWith(Feeder.class)
public class F4JfromFile {
	
	@Test 
	@Source("data/data.csv")//CSV source
	public void testAccessCheck_CSV(String userName, String pw, boolean expected) {
		assertEquals(expected, UserAccess.accessCheck(userName, pw));
	}
	
	@Test 
	@Source(uri = "data/data.xls", emptyMarker = "<empty>",nullMarker="<null>")//Excel source
	public void testAccessCheck_Excel(String userName, String pw, boolean expected) {
		assertEquals(expected, UserAccess.accessCheck(userName, pw));
	}
	
//	@Test 
//	@Source(uri = "data/data.xls", emptyMarker = "<empty>",nullMarker="<null>")//Excel source
//	public void testMap(Map<String, String> map, boolean expected) {
////		assertEquals(expected, UserAccess.accessCheck(userName, pw));
//	}
}